1
Evolusi Prompting: Dari Instruksi Dasar hingga Pemikiran Terstruktur
AI012Lesson 3
00:00

Hierarki Prompting: Dari Instruksi ke Logika

Prompting telah berkembang dari masukan berbasis perintah sederhana menjadiArsitektur Pemikiranyang memandu jalur pemrosesan internal model.

Konsep Inti

  • Prompting Zero-shot:Memberikan deskripsi tugas tanpa contoh apa pun (misalnya, "Terjemahkan ini ke bahasa Prancis").
  • Prompting Few-shot:Menggunakan "Demonstrasi" (pasangan input-ouput) untuk menentukan ruang label dan format yang diinginkan.
  • Rantai-Pemikiran (CoT):Teknik prompting yang mendorong model menghasilkan langkah-langkah pemikiran antara.
  • Sifat yang Muncul:Pemikiran kompleks tidak diprogram secara eksplisit tetapi "muncul" pada model yang biasanya melebihi parameter 10 miliar.

Perubahan dalam Pemikiran

  1. Mengikuti Instruksi:Pemetaan langsung dari input ke output.
  2. Pembelajaran dalam Konteks:Mempelajari pola dari contoh yang diberikan (Few-shot).
  3. Dekomposisi Logika:Memecah masalah menjadi langkah-langkah berurutan (CoT).
  4. Pengawasan Proses:Mengutamakan akurasi langkah-langkah "berpikir" dibandingkan jawaban akhir (seperti yang terlihat pada OpenAI o1).
Inti Penting
Kinerja model dalam skenario few-shot sangat sensitif terhadap distribusi label dan relevansi demonstrasi, bukan hanya jumlah contoh.
prompting_strategies.py
TERMINALbash — 80x24
> Ready. Click "Run" to execute.
>
Question 1
Which method relies on providing "demonstrations" to guide the model?
Zero-shot prompting
Few-shot prompting
Chain-of-Thought
Fine-tuning
Question 2
True or False: Chain-of-Thought reasoning is a capability found in almost all AI models regardless of size.
True
False
Challenge: Optimizing Logic Puzzles
Scenario: Optimize a prompt for a model that is struggling with a logic puzzle.
You are using an LLM to solve the following puzzle: "A bat and a ball cost $1.10 in total. The bat costs $1.00 more than the ball. How much does the ball cost?"

Currently, you are passing the prompt exactly as written above, and the model incorrectly answers "$0.10".
Task 1
Identify if the current prompt is Zero-shot or Few-shot.
Solution:
The current prompt is Zero-shot because it provides the task description without any prior examples or demonstrations of similar solved puzzles.
Task 2
Inject the Zero-shot CoT trigger phrase to improve reasoning accuracy. Rewrite the prompt.
Solution:
"A bat and a ball cost $1.10 in total. The bat costs $1.00 more than the ball. How much does the ball cost? Let's think step by step:"